package com.demo.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * @ClassName: OpcnetUserDetailsService
 * @Description:
 */

public class OpcnetUserDetailsService implements UserDetailsService {

	@Override
	public UserDetails loadUserByUsername(String username)
			throws UsernameNotFoundException {
		System.out.println("=================="+username);
		List<SimpleGrantedAuthority> list = new ArrayList<SimpleGrantedAuthority>();
		SimpleGrantedAuthority au = new SimpleGrantedAuthority("ROLE_USER");
		list.add(au);
		UserDetails user = new User("guest","abc",list);
		return user;
	}

}
